From 38ad8d2a5cddeaa0204616d1fd7766a818b8d539 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Tue, 10 Apr 2007 18:49:20 +0100 Subject: [PATCH] linux: Fix IRQ disable/enable logic across save/restore. stop_machine_run() executes our callback function with interrupts disabled. Signed-off-by: Keir Fraser --- .../drivers/xen/core/machine_reboot.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c b/linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c index 5f2e8cdee4..aa40702eed 100644 --- a/linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c +++ b/linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c @@ -127,8 +127,10 @@ static int take_machine_down(void *p_fast_suspend) extern void time_resume(void); if (fast_suspend) { - preempt_disable(); + BUG_ON(!irqs_disabled()); } else { + BUG_ON(irqs_disabled()); + for (;;) { err = smp_suspend(); if (err) @@ -143,11 +145,11 @@ static int take_machine_down(void *p_fast_suspend) preempt_enable(); xenbus_suspend_cancel(); } + + local_irq_disable(); } mm_pin_all(); - local_irq_disable(); - preempt_enable(); gnttab_suspend(); pre_suspend(); @@ -178,7 +180,9 @@ static int take_machine_down(void *p_fast_suspend) #endif } time_resume(); - local_irq_enable(); + + if (!fast_suspend) + local_irq_enable(); return suspend_cancelled; } -- 2.30.2